<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>books_edit</title>
    <link rel="stylesheet" href="/static/css/index.css">
    <link rel="stylesheet" href="/static/css/borrow_list.css">
</head>
<body>
<div class="header">
    {{if .}}
        <div>修改</div>
    {{else}}
        <div>新书上架</div>
    {{end}}
    <div>
        <a href="/logout">注销</a>
        <a href="/getBookByPage">图书管理</a>
        <a href="/getAllUser">用户管理</a>
        <a href="/main">返回</a>
    </div>
</div>
<div id="main">
    <form action="/editBook" method="post">
        <table>
            <tr>
                <td>书名</td>
                <td>作者</td>
                <td>出版社</td>
                <td>定价</td>
                <td>借阅量</td>
                <td>剩余量</td>
                <td colspan="2">操作</td>
            </tr>
            <tr>
                {{if .}}
                    <input name="bookId" type="hidden" value="{{.Id}}"/>
                    <td><input name="title" type="text" value="{{.Title}}"/></td>
                    <td><input name="author" type="text" value="{{.Author}}"/></td>
                    <td><input name="publish" type="text" value="{{.Publish}}"/></td>
                    <td><input name="price" type="text" value="{{.Price}}"/></td>
                    <td><input name="borrow" type="text" value="{{.Borrow}}"/></td>
                    <td><input name="remain" type="text" value="{{.Remain}}"/></td>
                {{else}}
                    <td><input name="title" type="text" value=""/></td>
                    <td><input name="author" type="text" value=""/></td>
                    <td><input name="publish" type="text" value=""/></td>
                    <td><input name="price" type="text" value=""/></td>
                    <td><input name="borrow" type="text" value=""/></td>
                    <td><input name="remain" type="text" value=""/></td>
                {{end}}
                <td><input type="submit" value="提交"/></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>